<?php if (!defined('BASEPATH')) exit ('No direct script access allowed');
class Owner_model extends CI_Model
{

	function __construct()
	{
		parent::__construct();
	}

	function getAll($type)
	{
		$this->db->select("owner.id as id, username, title, content, time_created, owner.status");
		$this->db->join('users', 'users.id = owner.user_id');
		$this->db->where('type',$type);
		return $this->db->get('owner');
	}

	function getAllPublish($type)
	{
		$this->db->select("owner.id as id, username, title, content, time_created, owner.status");
		$this->db->join('users', 'users.id = owner.user_id');
		$this->db->where('type',$type);
		$this->db->where('owner.status','1');
		return $this->db->get('owner');
	}
	
	function get_by_id($id)
	{
		$this->db->where('id',$id);
		return $this->db->get('owner');
	}
}

/* End of file owner_model.php */
/* Location: ./application/models/owner_model.php */